const tbody = document.querySelector(".tbody-list");
// console.log(tbody)

getData()
function getData(){
    utils.fetch("./api/v1/shop/selecte.php").then(resp => {
        if(resp.code === 200){
            // console.log(resp)
            str = "";
            const {list} = resp.body
            list.forEach(
              (shop,index) => {
                str += `<tr data-index=${shop.id}>
                  <td>${index+1}</td>
                  <td>
                      <span>${shop.name}</span>
                      <input type="text">
                  </td>
                  <td>
                      <span>${shop.price}</span>
                      <input type="text">
                  </td>
                  <td>
                      <span>${shop.num}</span>
                      <input type="text">
                  </td>
                  <td>
                      <button class="btn btn-xs btn-info btn-edit">编辑</button>
                      <button class="btn btn-xs btn-danger btn-del">删除</button>
                      <button class="btn btn-xs btn-success btn-ok">确定</button>
                      <button class="btn btn-xs btn-warning btn-cancel">取消</button>
                  </td>
              </tr>`;
              })
              tbody.innerHTML = str
        }
    });
}
